home *** CD-ROM | disk | FTP | other *** search
- #include "ToolSort.h"
-
- /*=========================================================================
- Module: Comp
-
- Purpose: Transforms e1 and e2 of type char * to the type Str255.
- Compares two strings: s1 and s2, returns -1 if
- s1 < s2, 0 if s1 == s2, and 1 if s1 > s2.
-
- Uses:
-
- Returns: eq
-
- =========================================================================*/
- Comp(e1, e2)
- Handle *e1;
- Handle *e2;
- {
- int eq = 0;
-
- long size1;
- long size2;
- Str255 s1;
- Str255 s2;
-
- size1 = GetHandleSize(*e1);
- size2 = GetHandleSize(*e2);
-
- if (size1<255 && size2<255) /* convert s1 & s2 to Str255 */
- {
- s1[0] = size1; /* set size byte */
- BlockMove( **e1, s1+1, (long)size1); /* copy string */
-
- s2[0] = size2; /* set size byte */
- BlockMove( **e2, s2+1, (long)size2); /* copy string */
-
- eq = RelString(s1, s2, (Boolean)0, (Boolean)0);
- }
- return(eq);
- }
-
- /*=========================================================================
- Module: Swap
-
- Purpose: Exchanges e1 with e2.
-
- Returns:
-
- =========================================================================*/
- Swap(e1, e2)
- Handle *e1; /* pointer to a Handle of a str of char */
- Handle *e2; /* pointer to a Handle of a str of char */
- {
- Handle temp;
-
- temp = *e1;
- *e1 = *e2;
- *e2 = temp;
- }
-
-